<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div></div>
    <div></div>
</body>

</html>
<script src="jQuery.js"></script>
<script>
    function getParams(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = decodeURI(window.location.search).substr(1).match(reg);
        if (r != null) return unescape(r[2]);
        return null;
    }

    // console.log(getParams("key"));
    $.ajax({
        url: "DetailPage.php",
        type: "get",
        data: {
            goodsId: getParams("goodsId")
        },
        success: function(resText) {
            let goodsInfor = JSON.parse(resText);
            $("div").eq(0).html(goodsInfor.key1);
            $("div").eq(1).html(goodsInfor.key2);
        }
    });
</script>